﻿<Fluent:RibbonWindow
				xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
				xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
				xmlns:Fluent="clr-namespace:Fluent;assembly=Fluent" x:Class="Visuals.MainWindow"
                xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock" xmlns:Panes="clr-namespace:Visuals.Panes"
				WindowStartupLocation="CenterScreen"
				Title="Relate2spot" Height="550" Width="950"
                WindowState="Maximized" Closed="RibbonWindow_Closed" Loaded="RibbonWindow_Loaded">
    <DockPanel LastChildFill="True">
        
        <Fluent:Ribbon Name="ribbon" DockPanel.Dock="Top">
            <Fluent:Ribbon.QuickAccessItems>
                <Fluent:QuickAccessMenuItem IsChecked="True" Target="{Binding ElementName=loadCorpusButton}"/>
                <Fluent:QuickAccessMenuItem IsChecked="False" Target="{Binding ElementName=openButton}"/>
                <Fluent:QuickAccessMenuItem IsChecked="False" Target="{Binding ElementName=saveButton}"/>
            </Fluent:Ribbon.QuickAccessItems>

            <Fluent:Ribbon.ContextualGroups>

            </Fluent:Ribbon.ContextualGroups>


            <Fluent:Ribbon.Menu>
                <Fluent:Backstage>
                    <Fluent:BackstageTabControl Name="backstage">
                        <Fluent:Button x:Name="loadCorpusButton" Header="Зареди корпус" Icon="images/load-corpus.png" Click="loadCorpusButton_Click" />
                        <Fluent:Button x:Name="openButton" Header="Отвори" Icon="images/open.png" Click="openButton_Click" />
                        <Fluent:Button x:Name="saveButton" Header="Запази" Icon="images/save.png" Click="saveButton_Click" />
                        <Fluent:BackstageTabItem Header="Допълнително">

                        </Fluent:BackstageTabItem>
                        <Fluent:BackstageTabItem Header="Настройки">
                            <Grid Margin="30" VerticalAlignment="Top" HorizontalAlignment="Left">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="300" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <Canvas>
                                    <Label Canvas.Top="0" Canvas.Left="0" Height="37" Width="300" Content="Стоп думи" FontSize="18" BorderThickness="0, 0, 0, 1" BorderBrush="#CCC" Foreground="Blue" />
                                    <TextBox Canvas.Left="0" Canvas.Top="55"  Grid.Column="0" Height="23" Name="stopWordInput" Width="250"/>
                                    <Button Canvas.Left="0" Canvas.Top="85" Grid.Column="0" Height="21" Width="50" Click="addStopWordButton_Click">Добави</Button>
                                    <Button Canvas.Left="70" Canvas.Top="85" Grid.Column="0" Height="21" Width="50" Click="removeStopWordButton_Click">Премахни</Button>
                                    <ListView Canvas.Left="0" Canvas.Top="115" Grid.Column="0" Height="183" Name="stopWordsList" Width="250" SelectionMode="Single">
                                        <ListView.View>
                                            <GridView>
                                                <GridViewColumn Header="Стоп дума" Width="220"></GridViewColumn>
                                            </GridView>
                                        </ListView.View>
                                    </ListView>
                                </Canvas>
                            </Grid>
                        </Fluent:BackstageTabItem>
                        <Fluent:Button x:Name="aboutButton" Header="Информация" Icon="images/load-corpus.png" Click="aboutButton_Click" />
                    </Fluent:BackstageTabControl>
                </Fluent:Backstage>
            </Fluent:Ribbon.Menu>

            <Fluent:RibbonTabItem Header="Главни функиции" Name="generalTab" Focusable="True">
                <Fluent:RibbonGroupBox Header="Настройки">
                    <Fluent:Spinner x:Name="numberOfDimensions" Header="Измерения" Value="0" Minimum="0">
                        <Fluent:Spinner.ToolTip>
                            <Fluent:ScreenTip Title="Брой на латентните измерения" Text="Трябва да се зададе преди да се зареди корпусът. Показва колко измерения ще съдържа латентното пространство. Максималната стойност е броят на файловете. Остаете 0 за максимален брой, но имайте предвид, че това не винаги е оптималната стойност." MaxWidth="300" />
                        </Fluent:Spinner.ToolTip>
                    </Fluent:Spinner>
                    <Fluent:Spinner x:Name="numberOfGraphicNodes" Header="Графични клонове" Value="8" Minimum="3" Maximum="20">
                        <Fluent:Spinner.ToolTip>
                            <Fluent:ScreenTip Title="Брой основни графични клонове." Text="Броят графични клонове в централната графика." />
                        </Fluent:Spinner.ToolTip>
                    </Fluent:Spinner>
                    <Fluent:CheckBox x:Name="useTfIdf" Header="Използва TF-IDF" IsChecked="False">
                        <Fluent:CheckBox.ToolTip>
                            <Fluent:ScreenTip Name="useTfIdfToolTip" Title="Използва Term Frequency - Inverse Document Frequency" Text="Трябва да се зададе преди да се зареди корпусът. Това е метод за запълване на честотната матрица." />
                        </Fluent:CheckBox.ToolTip>
                    </Fluent:CheckBox>
                    <Fluent:CheckBox x:Name="shouldStem" Header="Сегментация" IsChecked="False">
                        <Fluent:CheckBox.ToolTip>
                            <Fluent:ScreenTip Title="Сегментация" Text="Ще преубразува думи като relates, relating в relate. Може да възникнат проблеми като relat." />
                        </Fluent:CheckBox.ToolTip>
                    </Fluent:CheckBox>

                </Fluent:RibbonGroupBox>
                <Fluent:RibbonGroupBox Header="Други">
                    <Fluent:Button Name="rebuildButton" Header="Изграждане" Icon="Images\Green.png" LargeIcon="Images\GreenLarge.png" Click="rebuildButton_Click">
                        <Fluent:Button.ToolTip>
                            <Fluent:ScreenTip Title="Изграждане на матрица" Text="Изграждане на матрицата с използване на новите настройки."/>
                        </Fluent:Button.ToolTip>
                    </Fluent:Button>
                    <Fluent:Button Name="searchButton" Header="Търсене" Icon="Images\Green.png" LargeIcon="Images\GreenLarge.png" Click="searchButton_Click">
                    </Fluent:Button>
                </Fluent:RibbonGroupBox>

            </Fluent:RibbonTabItem>
            <Fluent:RibbonTabItem Header="Групиране" Name="groupsTab" Focusable="True">
                <Fluent:RibbonGroupBox Header="Думи">
                    <Fluent:Spinner x:Name="wordsClustersSpinner" Header="Брой на групите" Value="1" Minimum="1" Maximum="2">
                        <Fluent:Spinner.ToolTip>
                            <Fluent:ScreenTip Title="Брой групи" Text="Задават се броят на групите, на които да се разделят думите." />
                        </Fluent:Spinner.ToolTip>
                    </Fluent:Spinner>
                    <Fluent:Spinner x:Name="wordsPerClusterSpinner" Header="Думи на група" Value="1" Minimum="1" Maximum="2">
                        <Fluent:Spinner.ToolTip>
                            <Fluent:ScreenTip Title="Брой думи в група" Text="Задават се броят на първите резултати във всяка група, които ще се показват." />
                        </Fluent:Spinner.ToolTip>
                    </Fluent:Spinner>
                    <Fluent:Button Name="wordsGroup" Header="Група" Icon="Images\Green.png" LargeIcon="Images\GreenLarge.png" IsEnabled="False" Click="wordsGroup_Click">
                        <Fluent:Button.ToolTip>
                            <Fluent:ScreenTip Title="Групиране на думи" Text="Групиране на думите спрямо зададените настройки."/>
                        </Fluent:Button.ToolTip>
                    </Fluent:Button>
                    <Fluent:Button Name="wordsGroupsPreview" Header="Преглед" Icon="Images\Green.png" LargeIcon="Images\GreenLarge.png" IsEnabled="False" Click="wordsGroupsPreview_Click">

                    </Fluent:Button>
                </Fluent:RibbonGroupBox>
            </Fluent:RibbonTabItem>
            <Fluent:RibbonTabItem Header="Специфика на думата" Visibility="Visible">
                <Fluent:RibbonGroupBox Header="Основни">
                    <Fluent:Button Name="wordToWordButton" Header="Дума-Дума" Icon="Images\Green.png" LargeIcon="Images\GreenLarge.png" IsEnabled="False" Click="wordToWordButton_Click_1">
                        <Fluent:Button.ToolTip>
                            <Fluent:ScreenTip Title="Връзка тип дума-дума" Text="Тази функция дава коефицента на подобност между две думи."/>
                        </Fluent:Button.ToolTip>
                    </Fluent:Button>
                    <Fluent:Button Name="wordsChartButton" Header="Думи 2D" Icon="Images\Green.png" LargeIcon="Images\GreenLarge.png" Click="wordsChartButton_Click">
                        <Fluent:Button.ToolTip>
                            <Fluent:ScreenTip Title="Графика на думите" Text="Показва всички избрани думи в двумерното пространство като можете да избирате кои измерения да виждате."/>
                        </Fluent:Button.ToolTip>
                    </Fluent:Button>
                </Fluent:RibbonGroupBox>
            </Fluent:RibbonTabItem>
        </Fluent:Ribbon>

        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>

            <ad:DockingManager x:Name="dockManager" Grid.Row="0">
                <ad:ResizingPanel>
                    <ad:DockablePane ad:ResizingPanel.ResizeWidth="200">
                        <ad:DockableContent Title="Документи" Icon="Images/Gray.png">
                            <Panes:DocumentsListControl x:Name="documentsListControl"/>
                        </ad:DockableContent>
                        <ad:DockableContent Title="Субекти" Icon="Images/Gray.png">
                            <Panes:WordsListControl x:Name="wordsListControl" Callback="WordsListClickCallback" AddToGraphCallback="AddWordToGraph" />
                        </ad:DockableContent>
                    </ad:DockablePane>

                    <ad:DocumentPane x:Name="centralPane">
                        <ad:DockableContent Title="Добре дошли" Background="White">
                            <Panes:WelcomeControl />
                        </ad:DockableContent>
                    </ad:DocumentPane>

                    <ad:DockablePane ad:ResizingPanel.ResizeWidth="150">
                        <ad:DockableContent Title="Резултати от интернет" Icon="Images/Gray.png" Background="White">
                            <Panes:WebResultsControl x:Name="webResultsControl"/>
                        </ad:DockableContent>
                    </ad:DockablePane>

                </ad:ResizingPanel>
            </ad:DockingManager>
        </Grid>
    </DockPanel>
</Fluent:RibbonWindow>
